package Model;

/**
 * Attack player class (Implements PlayerField interface)
 * @author Jose Filipe M Santos - 7277502
 * @author Matheus Martins Teixeira - 7277482
 */
public class PlayerAt extends Player implements PlayerField{

    private int Speed;
    private int Tecnique;
    private int Goals;

    /**
     * PlayerAt constructor (only one)
     *
     * @param pName Player's name
     * @param pAge  PLayer's age
     * @param pHab  Player's general hability
     * @param pSp   Player's speed attribute
     * @param pTec  Player's tecnique attribute
     */
    public PlayerAt(String pName, int pAge, int pHab, int pSp, int pTec){

        super(pName, pAge, pHab);
        this.Speed = pSp;
        this.Tecnique = pTec;
        this.Goals = 0;

    }

    /**
     * Returns attack player specific hability ((2 * speed + general hability * 5 + 3 * tecnique) / 10)
     *
     * @return Attack player's specific hability
     */
    @Override
    public int getHability(){

        int Hab = super.getHability();
        return ( ((this.Speed * 2)  + (Hab * 5) + (this.Tecnique * 3)) / 10  );

    }

    /**
     * Returns the number of goals given to the attack player
     *
     * @return Number of goals
     */
    @Override
    public int getGoals(){

        return Goals;

    }

    /**
     * Returns the player's speed (specific to attack players)
     *
     * @return Attack player's speed
     */
    public int getSpeed() {
	return Speed;
    }

    /**
     * Returns the player's tecnique (specific to attack players)
     *
     * @return Attack player's tecnique
     */
    public int getTecnique() {
	return Tecnique;
    }

    /**
     * Sum 1 to the current goal record
     */
    @Override
    public void sumGoal(){

        this.Goals++;

    }

}
